
//document的属性方法
function doms(){
		  
	  var _dd = document.documentElement;
	  var _db = document.body;
	  var _dom = _dd || _db;

	  
	  return{
		  width:  Math.max(_dom.clientWidth, _dom.scrollWidth),		// 页面宽度
		  height: Math.max(_dom.clientHeight, _dom.scrollHeight),	// 页面长度
		  left: Math.max(_dd.scrollLeft, _db.scrollLeft),			// 被滚动条卷去的文档宽度
		  top: Math.max(_dd.scrollTop, _db.scrollTop),				// 被滚动条卷去的文档高度
		  viewHeight: _dom.clientHeight,
		  viewWidth: _dom.clientWidth
	  };
};

//银行支付弹出窗口
(function(){
		  
	var payPop = {};
	
	window.payPop = payPop;	  
		  
	var $d = function(id){return document.getElementById(id)?document.getElementById(id):id;};	
	
	//弹出层
	payPop.open = function(){

		var dom = doms();
		
		
		//alert(dom.viewHeight);
		//背景
		with($d('n_popUpLayerOverlay')){
			//style.width = dom.width + 'px';
			style.height = dom.height + 'px';
			//getElementsByTagName('iframe')[0].style.width = dom.width  + 'px';
			getElementsByTagName('iframe')[0].style.height = dom.height + 'px';
			style.display = 'block';
		}
		//信息框
		 with($d('n_popUpLayer')){
			style.display = 'block';
			style.left = dom.width/2 - (offsetWidth/2) + 'px';
			style.top = dom.top + (dom.viewHeight/2 - offsetHeight/2 - 50) + 'px';
		}
		 
	};
	
	payPop.close = function(){
		$d('n_popUpLayer').style.display = 'none';	
		$d('n_popUpLayerOverlay').style.display = 'none';	
	};
	
	
})();
